<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin: 0;padding:0;box-sizing: border-box}
        html,body,.container{
            width: 100%;
            height: 100%;
            overflow: hidden;
            position:relative;
        }
    </style>
</head>
<body>
    <div class="container">
        <canvas width="375" height="667"></canvas>
    </div>

    <script>
        //canvas 画布  绘制. 网页游戏, 地图, 图标.

        //使用步骤
        //1. 获取 canvas 画布
        const canvas = document.querySelector('canvas');

        //2. 创建画笔对象
        const ctx = canvas.getContext('2d');

        //3. 开始绘制
        ctx.beginPath();

        //4. 移动画笔
        ctx.moveTo(50, 50); // move 移动  to 去哪儿

        //5. 绘制直线
        ctx.lineTo(250, 50);
        ctx.lineTo(250, 250);
        ctx.lineTo(50, 50);

        //6. 描边
        ctx.stroke();

    </script>
</body>
</html>